home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
intrvews
/
xgrab.lha
/
xgrab
/
ui
/
select.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-06
|
1KB
|
62 lines
/**
GRAB Graph Layout and Browser System
Copyright (c) 1986, 1988 Regents of the University of California
Copyright (c) 1989, Tera Computer Company
**/
/* select.c -- routine to get ranges */
#include "digraph.h"
#include "screen.h"
FindRange(digraph, box)
DIGRAPH *digraph;
BOX *box;
{
NODE *node;
int first = 1;
box->min_x = box->min_y = box->max_x = box->max_y = 0;
each_node(digraph, node)
loop
if (first)
{
box->min_x = X_left(Node_member(node));
box->max_x = X_right(Node_member(node));
box->min_y = Y_bottom(Node_member(node));
box->max_y = Y_top(Node_member(node));
first = FALSE;
continue;
}
if (X_left(Node_member(node)) < box->min_x)
{
box->min_x = X_left(Node_member(node));
}
if (X_right(Node_member(node)) > box->max_x)
{
box->max_x = X_right(Node_member(node));
}
if (Y_bottom(Node_member(node)) < box->min_y)
{
box->min_y = Y_bottom(Node_member(node));
}
if (Y_top(Node_member(node)) > box->max_y)
{
box->max_y = Y_top(Node_member(node));
}
endloop
if ((box->min_x == box->max_x) || (box->min_y == box->max_y))
{
box->max_x++;
box->max_y++;
}
}